unit ufrmSetup;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    procedure AddMsg(const AMsg:string);
    procedure ClearMsg;
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
uses
   unitResFile, unitResourceVersionInfo, unitResourceDetails;

{$R *.dfm}

procedure TForm1.AddMsg(const AMsg:string);
begin
  Memo1.Lines.Add(AMsg);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  cDetail: TResourceDetails;
  cResMod:TResModule;
  i: Integer;
  iKey: Integer;
begin
  ClearMsg;
  cResMod := TResModule.Create;
  try
    cResMod.LoadFromFile(edit1.Text);
    for i := 0 to cResMod.ResourceCount - 1 do
    begin
      cDetail := cResMod.ResourceDetails[i];
     // cResMod.FindResource()
     //RT_BITMAP
      AddMsg(cDetail.ResourceType + ' : ' + cDetail.ResourceName + '  ==  ' + IntToStr(cDetail.ResourceLanguage) + '  ==  ' + cDetail.ClassName);


      //cDetail. .Parent.FindResource()
      //cDetail.

      if cDetail is TVersionInfoResourceDetails then
      begin
        AddMsg('  ---------- Version Info -----------');
        with TVersionInfoResourceDetails(cDetail) do

          for iKey := 0 to KeyCount - 1 do
            AddMsg(format('  %s = %s', [Key[iKey].KeyName, Key[iKey].Value]));
      end;
    end;
  finally
    cResMod.Free;
  end;

end;

procedure TForm1.ClearMsg;
begin
  Memo1.Clear;
end;

end.
